<template>
  <div>
    <el-card>
      <div class="box">
        <img :src="userStore.avatar" alt="" class="avatar" />
        <div class="info">
          <!--        h3 默认样式都被清除了-->
          <h3 class="title">{{ getTime() + '好👌' + userStore.username }}</h3>
          <p class="subtitle">{{ $t('home.subtitle') }}</p>
        </div>
      </div>
    </el-card>
    <div class="bottom">
      <svg-icon name="welcome" width="500px" height="500px" />
    </div>
  </div>
</template>
<script setup lang="ts">
import useUserStore from '@/store/modules/user.ts'
import { getTime } from '@/utils/time.ts'
// 获取存储用户信息的store，得到头像、用户名等
const userStore = useUserStore()
</script>

<style scoped lang="scss">
.box {
  display: flex;
  align-items: center;

  .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }

  .info {
    margin-left: 20px;

    .title {
      font-size: 30px;
      font-weight: 900;
      margin-bottom: 30px;
    }

    .subtitle {
      font-style: italic;
      color: #8c939d;
    }
  }
}

.bottom {
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
